home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form GSort
- BackColor = &H00C0C0C0&
- Caption = "Group Sort Fields"
- ClientHeight = 5385
- ClientLeft = 1680
- ClientTop = 2010
- ClientWidth = 6720
- Height = 6075
- Left = 1620
- LinkTopic = "Form1"
- ScaleHeight = 5385
- ScaleWidth = 6720
- Top = 1380
- Width = 6840
- Begin CommandButton Command8
- Caption = "Help"
- Height = 420
- Left = 2610
- TabIndex = 15
- Top = 3870
- Width = 2085
- End
- Begin CommandButton Command6
- Caption = "Ok"
- Height = 420
- Left = 360
- TabIndex = 14
- Top = 3870
- Width = 2085
- End
- Begin TextBox Text3
- Height = 1050
- Left = 360
- TabIndex = 11
- Top = 2025
- Width = 6045
- End
- Begin TextBox Text2
- Enabled = 0 'False
- Height = 420
- Left = 2610
- TabIndex = 10
- Top = 630
- Width = 1005
- End
- Begin TextBox Text1
- Height = 375
- Left = 2610
- TabIndex = 9
- Top = 1530
- Width = 1005
- End
- Begin SSPanel Panel3D2
- Alignment = 1 'Left Justify - MIDDLE
- BevelInner = 1 'Inset
- BorderWidth = 1
- Height = 1050
- Left = 4860
- TabIndex = 6
- Top = 3240
- Width = 1545
- Begin SSOption Option3D1
- Caption = "Descending"
- Height = 330
- Index = 1
- Left = 90
- TabIndex = 8
- Top = 585
- Width = 1275
- End
- Begin SSOption Option3D1
- Caption = "Ascending"
- Height = 330
- Index = 0
- Left = 90
- TabIndex = 7
- Top = 135
- Width = 1275
- End
- End
- Begin CommandButton Command5
- Caption = "Set Group Sort Field"
- Height = 420
- Left = 2610
- TabIndex = 5
- Top = 3240
- Width = 2085
- End
- Begin CommandButton Command4
- Caption = "Get Group Sort Field"
- Height = 420
- Left = 360
- TabIndex = 4
- Top = 3240
- Width = 2085
- End
- Begin CommandButton Command3
- Caption = "# Group Sort Fields"
- Height = 420
- Left = 360
- TabIndex = 3
- Top = 630
- Width = 1905
- End
- Begin CommandButton Command2
- Caption = ">>"
- Height = 420
- Left = 1440
- TabIndex = 2
- Top = 1485
- Width = 915
- End
- Begin CommandButton Command1
- Caption = "<<"
- Height = 420
- Left = 360
- TabIndex = 1
- Top = 1485
- Width = 915
- End
- Begin SSPanel StatusBar
- Alignment = 1 'Left Justify - MIDDLE
- BorderWidth = 1
- Height = 510
- Left = 0
- TabIndex = 0
- Top = 4905
- Width = 7395
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- Caption = "Group Sort Field Number"
- Height = 240
- Left = 2610
- TabIndex = 13
- Top = 1170
- Width = 2175
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Caption = "# of Group Sort Fields"
- Height = 240
- Left = 2610
- TabIndex = 12
- Top = 270
- Width = 2175
- End
- Begin Menu MenuFile
- Caption = "&File"
- Begin Menu MenuExit
- Caption = "&Exit"
- End
- End
- Dim NumFields As Integer
- Sub Command1_Click ()
- Dim nSort As Integer
- If (SortN > 0) Then
- SortN = SortN - 1
- Text1.Text = SortN
- End If
- End Sub
- Sub Command2_Click ()
- Dim nSorts As Integer
- nSorts = PEGetNGroupSortFields(JobNum)
- If nSorts = 0 Then
- Text1.Text = 0
- Else
- If (SortN < nSorts - 1) Then
- SortN = SortN + 1
- Text1.Text = SortN
- End If
- End If
- End Sub
- Sub Command3_Click ()
- NumFields = PEGetNGroupSortFields(JobNum)
- If NumFields >= 0 Then
- GSort!StatusBar.Caption = "# of Sort fields Retrieved"
- Text1.Text = 0
- Text2.Text = NumFields
- Else
- RCode = GetErrorString(JobNum)
- MsgBox "PEGetNGroupSortFields Error #: " + Str(ErrorCode) + " - " + RCode
- End If
- End Sub
- Sub Command4_Click ()
- Dim TextHandle As Integer, TextLength As Integer
- Dim FieldName As String
- If NumFields = 0 Then
- MsgBox ("There are no sort fields to retrieve.")
- Else
- If PEGetNthGroupSortField(JobNum, Text1.Text, TextHandle, TextLength, d%) = False Then
- RCode = GetErrorString(JobNum)
- MsgBox "PEGetNthGroupSortField Error #: " + Str(ErrorCode) + " - " + RCode
- End If
- ' Allocate memory for FieldName
- FieldName = String$(TextLength, " ")
- If PEGetHandleString(TextHandle, FieldName, TextLength) = False Then
- RCode = GetErrorString(JobNum)
- MsgBox "PEGetHandleString Error #: " + Str(ErrorCode) + " - " + RCode
- Else
- GSort!StatusBar.Caption = "Group Sort field number " + Text1.Text + " has been retrieved"
- Text3.Text = FieldName
- End If
- If d% = 0 Then
- Option3d1(1).Value = True
- Option3d1(0).Value = False
- Else
- Option3d1(0).Value = True
- Option3d1(1).Value = False
- End If
- End If
- End Sub
- Sub Command5_Click ()
- If Text3.Text = "" Then
- MsgBox "You must enter a field name to set the sort direction!"
- Else
- ' Now Set the sort field with new direction
- If Option3d1(0) = True Then
- d% = 1
- Else
- d% = 0
- End If
- If PESetNthGroupSortField(JobNum, Text1.Text, Text3.Text, d%) = False Then
- RCode = GetErrorString(JobNum)
- MsgBox "PESetNthSortField Error #: " + Str(ErrorCode) + " - " + RCode
- Else
- GSort!StatusBar.Caption = "Group Sort field number " + Text1.Text + " has been set."
- End If
- End If
- End Sub
- Sub Command6_Click ()
- Unload Me
- End Sub
- Sub Command8_Click ()
- RCode = Shell("Winhelp c:\crw\crw.hlp", 3)
- If RCode = False Then
- MsgBox ("CRWDEMO cannot find the Crystal Help file in C:\CRW directory")
- End If
- End Sub
- Sub MenuExit_Click ()
- Unload Me
- End Sub
-